﻿// JSON C# Class Generator
// http://at-my-window.blogspot.com/?page=json-class-generator

using System;
using Newtonsoft.Json.Linq;
using JsonCSharpClassGenerator;
using TomatoSynchronizer.Store;
using System.Collections.Generic;
using System.Collections.Specialized;

namespace TomatoSynchronizer.Entities 
{
    public class ProductAttributGroup : IComparable 
    {

    	private IStore<ProductAttributGroup> store;
		public IStore<ProductAttributGroup> Store
		{
			get
			{
				return store;
			}
			set
			{
				store = value;
			}
		}
		
        public ProductAttributGroup()
        {
        }

        public ProductAttributGroup(string json)
         : this(JObject.Parse(json))
        {
        }

        private JObject __jobject;
        public ProductAttributGroup(JObject obj)
        {
            this.__jobject = obj;
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
        
        public int CompareTo(object obj)
		{

			if (obj is ProductAttributGroup)
			{

				ProductAttributGroup att = (ProductAttributGroup)obj;								

				return _products_ProductAttributGroupes_groups_id.CompareTo(att._products_ProductAttributGroupes_groups_id);

			}
			else
				throw new ArgumentException("Object is not a Category");
		}        

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private int _products_ProductAttributGroupes_groups_id;
        public int products_ProductAttributGroupes_groups_id
        {
            get
            {
                if(_products_ProductAttributGroupes_groups_id == null)
                    _products_ProductAttributGroupes_groups_id = JsonClassHelper.ReadInteger(JsonClassHelper.GetJToken<JValue>(__jobject, "products_ProductAttributGroupes_groups_id"));
                return _products_ProductAttributGroupes_groups_id;
            }
            set
            {
                _products_ProductAttributGroupes_groups_id = value;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private string _products_ProductAttributGroupes_groups_name;
        public string products_ProductAttributGroupes_groups_name
        {
            get
            {
                if(_products_ProductAttributGroupes_groups_name == null)
                    _products_ProductAttributGroupes_groups_name = JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "products_ProductAttributGroupes_groups_name"));
                return _products_ProductAttributGroupes_groups_name;
            }
            set
            {
                _products_ProductAttributGroupes_groups_name = value;
            }
        }

        private List<ProductAttributGroupEntry> _entries;
		
		public List<ProductAttributGroupEntry> Entries {
			get { return _entries; }
			set { _entries = value; }
		}
    }
}
